<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>首页</title>
</head>

<body>
  <h3>我是一个html首页</h3>
  <div>{{id}}</div>
  <h1 id="showid"></h1>
  <script>
    // let url = new URL(location.href)
    // let id = url.searchParams.get('id')
    let search = new URLSearchParams(location.search)
    let id = search.get('id')
    document.querySelector('#showid').textContent = id
  </script>
</body>

</html>